n = int(input())
points = []
for _ in range(n):
    points.append(list(map(int, input().split())))
# 分别处理x x方  y y方的前缀和
prefix_x = [0] * (n+1)
prefix_x2 = [0] * (n+1)
prefix_y = [0] * (n+1)
prefix_y2 = [0] * (n+1)
for i in range(n):
    x,y = points[i]
    prefix_x[i+1] += prefix_x[i] + x
    prefix_y[i+1] += prefix_y[i] + y
    prefix_x2[i+1] += prefix_x2[i] + x**2
    prefix_y2[i+1] += prefix_y2[i] + y**2
ans = 0
for i in range(1,n):
    x,y = points[i]
    ans += i * x**2 - 2*x*(prefix_x[i])+prefix_x2[i]
    ans += i * y**2 - 2*y*(prefix_y[i])+prefix_y2[i]
print(ans)

